<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">











<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>NPanday - Importing Projects</title>
    <style type="text/css" media="all">
      @import url("../css/maven-base.css");
      @import url("../css/maven-theme.css");
      @import url("../css/site.css");
    </style>
    <link rel="stylesheet" href="../css/print.css" type="text/css" media="print" />
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
      </head>
  <body class="composite">
    <div id="banner">
                    <span id="bannerLeft">
    
                                            <img src="../." alt="" />
    
            </span>
                          <span id="bannerRight">
    
                                            <img src=".././images/logo-home.png" alt="" />
    
            </span>
            <div class="clear">
        <hr/>
      </div>
    </div>
    <div id="breadcrumbs">
          
  

  
    
  
  
    
            <div class="xleft">
        Last Published: 2010-01-21
                      </div>
            <div class="xright">      
  

  
    
  
  
    
  </div>
      <div class="clear">
        <hr/>
      </div>
    </div>
    <div id="leftColumn">
      <div id="navcolumn">
           
  

  
    
  
  
    
                   <h5>General Info</h5>
            <ul>
              
    <li class="none">
                    <a href="../index.html">NPanday Overview</a>
          </li>
              
    <li class="none">
                    <a href="../release-notes.html">NPanday Release Notes</a>
          </li>
              
    <li class="none">
                    <a href="../faqs.html">NPanday FAQs</a>
          </li>
              
    <li class="none">
                    <a href="../workarounds.html">NPanday Workarounds</a>
          </li>
              
    <li class="none">
                    <a href="../plugins/index.html">NPanday Plugins</a>
          </li>
              
    <li class="none">
                    <a href="../conventions.html">Conventions</a>
          </li>
          </ul>
              <h5>Getting Started</h5>
            <ul>
              
                
              
      
            
      
            
      
              
        <li class="collapsed">
                    <a href="../installation/index.html">Installation</a>
                </li>
              
                
              
      
            
      
              
        <li class="collapsed">
                    <a href="../installation/uninstall.html">Uninstall NPanday</a>
                </li>
              
    <li class="none">
                    <a href="../guide/build_tool.html">Using the Build Tool</a>
          </li>
              
    <li class="none">
                    <a href="../guide/dependencies.html">Project Dependencies</a>
          </li>
              
    <li class="none">
                    <a href="../guide/install_file.html">Installing Files Manually</a>
          </li>
              
    <li class="none">
                    <a href="../guide/simple_project.html">Creating a Simple Project</a>
          </li>
              
    <li class="none">
                    <a href="../guide/load_project.html">Loading Project/Solution</a>
          </li>
              
    <li class="none">
                    <a href="../guide/quickstart.html">Quick Start</a>
          </li>
              
    <li class="none">
                    <a href="../guide/portability.html">Portability</a>
          </li>
          </ul>
              <h5>IDE Integration</h5>
            <ul>
              
    <li class="none">
                    <a href="../ide/execute_goals.html">Executing Maven Goals</a>
          </li>
              
    <li class="none">
                    <a href="../ide/assembly_key.html">Setting Assembly Key</a>
          </li>
              
    <li class="none">
                    <a href="../ide/remote_repo.html">Remote Repository</a>
          </li>
              
    <li class="none">
                    <a href="../ide/settings.html">Using Custom Settings</a>
          </li>
              
    <li class="none">
              <strong>Importing Projects</strong>
        </li>
              
    <li class="none">
                    <a href="../ide/artifacts.html">Repository Artifacts</a>
          </li>
              
    <li class="none">
                    <a href="../ide/references.html">Project References</a>
          </li>
              
    <li class="none">
                    <a href="../ide/web_references.html">Web References</a>
          </li>
              
                
              
      
            
      
              
        <li class="collapsed">
                    <a href="../ide/release.html">Releasing Project</a>
                </li>
              
    <li class="none">
                    <a href="../ide/test.html">Integration Test</a>
          </li>
          </ul>
              <h5>Project Information</h5>
            <ul>
              
    <li class="none">
                    <a href="../..">NPanday Site</a>
          </li>
              
    <li class="none">
                    <a href="https://npanday.svn.codeplex.com/svn/" class="externalLink">NPanday SVN</a>
          </li>
              
    <li class="none">
                    <a href="http://maven.apache.org/" class="externalLink">Maven</a>
          </li>
              
    <li class="none">
                    <a href="http://www.mono-project.com/" class="externalLink">Mono Project</a>
          </li>
              
    <li class="none">
                    <a href="http://dotgnu.org/" class="externalLink">DotGNU</a>
          </li>
          </ul>
              <h5>Project Documentation</h5>
            <ul>
              
                
              
      
            
      
            
      
            
      
            
      
            
      
            
      
            
      
            
      
            
      
            
      
              
        <li class="collapsed">
                    <a href="../project-info.html">Project Information</a>
                </li>
          </ul>
                                           <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
            <img alt="Built by Maven" src="../images/logos/maven-feather.png"></img>
          </a>
                       
  

  
    
  
  
    
        </div>
    </div>
    <div id="bodyColumn">
      <div id="contentBox">
        <div class="section"><h2>Importing Projects</h2>
<p>This section provides procedures on importing a Visual Studio project using Generate Solution's POM Information... feature. This feature will generate <tt>pom.xml</tt> files from an existing Visual Studio solution file. The generated <tt>pom.xml</tt> file will contain the latest versions of the artifact dependencies used for the project.</p>
<p><b>Note</b>: ASP.NET MVC should be installed to get the proper behavior when importing projects especially those projects with unsupported project types. (Refer to <a href="../installation/index.html"> Pre-requisites</a> section.)</p>
<ol type="1"><li>Right click on the project and select the Generate Solution's POM Information...<br />
.<img src="../images/import.jpg" /></li>
<li>In the pop-up screen, Browse to the directory location of the parent solution file to use. Group Id is generated by default with the format of <tt>[company_id].[solution_name]</tt>.<br />
.<img src="../images/import_screen.jpg" alt="Importing parent solution file" /></li>
<li>Click Generate POMs.<p>Underscores and spaces in artifact's groupId are automatically deleted when added to the project's <tt>pom.xml</tt>. The table below shows the conversion of certain values of groupIds.</p>
<table class="bodyTable"><tbody><tr class="a"><td align="left"><b>Artifact Group Id</b></td>
<td align="left"><b>Converted Group Id</b></td>
</tr>
<tr class="b"><td align="left">The.Project</td>
<td align="left">The.Project</td>
</tr>
<tr class="a"><td align="left">the.project</td>
<td align="left">the.project</td>
</tr>
<tr class="b"><td align="left">the project</td>
<td align="left">TheProject</td>
</tr>
<tr class="a"><td align="left">the_project</td>
<td align="left">TheProject</td>
</tr>
</tbody>
</table>
</li>
<li>From the Project Units Tests window, select the test modules to be used for the project and click OK.<br />
.<img src="../images/unit_test.jpg" alt="Project unit tests list" /><p><tt>pom.xml</tt> files will be generated for all the projects that are included in the solution file: the parent project and its sub-projects, if there are any.</p>
<p><b>Note</b>: The Units Tests window is not displayed when importing unsupported project types. Hence, an unsupported project type warning is displayed. For multi-module projects with supported and/or unsupported project types, the supported projects are included in the parent pom while for the unsupported project types, these are not included in the parent pom, and a warning is displayed.</p>
<p>For projects with web references, the <tt>pom.xml</tt> generated will contain <tt>maven-wsdl-plugin</tt> configuration similar to the following:</p>
<div class="source"><pre>  &lt;plugin&gt;
    &lt;groupId&gt;npanday.plugin&lt;/groupId&gt;
    &lt;artifactId&gt;maven-wsdl-plugin&lt;/artifactId&gt;
    &lt;extensions&gt;true&lt;/extensions&gt;
    &lt;executions&gt;
      &lt;execution&gt;
        &lt;goals&gt;
          &lt;goal&gt;wsdl&lt;/goal&gt;
        &lt;/goals&gt;
      &lt;/execution&gt;
    &lt;/executions&gt;
    &lt;configuration&gt;
      &lt;webreferences&gt;
        &lt;webreference&gt;
          &lt;namespace&gt;AnotherWebService&lt;/namespace&gt;
          &lt;path&gt;Web References/AnotherWebService/AnotherWS.wsdl&lt;/path&gt;
          &lt;output&gt;Web References/AnotherWebService/&lt;/output&gt;
        &lt;/webreference&gt;
      &lt;/webreferences&gt;
    &lt;/configuration&gt;
  &lt;/plugin&gt;</pre>
</div>
<p>The wsdl goal is the one responsible for building and creating webservice proxy classes. And, all the web references used in the project are listed inside the <tt> &lt;webreferences&gt; </tt> tag. For more instructions on adding, renaming, and deleting web references, refer to <a href="references.html"> Web References</a> section of this document.</p>
</li>
</ol>
<div class="section"><h3>Importing Projects with Resource File</h3>
<p>If the project you are importing includes a resource file, the <tt>maven-resgen</tt> plugin is added to <tt>pom.xml</tt> during import.</p>
<p>In the plugin's configuration, you can find the list of resource (<tt>resx</tt>) files with corresponding names. By default, <tt>RootNamespace</tt> is the assembly name and <tt>RootNamespace.Filename</tt> is the filename of the <tt>resx</tt> files. To ensure that the plugin works, the following are required:</p>
<ul><li>The classname and the filename of the item that contains the resx files must have the same name. Example:<p><tt>&quot;public class frmMaestroName&quot; = frmMaestroName.resx = frmMaestroName.cs</tt></p>
<p><b>Note</b>: Changing the codefile(.cs/.vb) automatically updates the resource(resx) file. In some instances, however, this does not hold true.</p>
</li>
<li>The namespace of the project should be equal to the DefaultNamespace of the project assembly. To check the default name,<ul><li>Right-click on the project and select Properties. This displays a project property window.</li>
<li>Select the Application tab.</li>
<li>In the DefaultNamespace field, you will find <tt>RootNamespace</tt>.</li>
</ul>
</li>
</ul>
<p>Once the above requirements are met, the importer automatically does the work and there is no need to edit <tt>pom.xml</tt>.</p>
<p>Removing the configuration part of the <tt>maven-resgen</tt> plugin allows the plugin to locate all the resx files and compile them as <tt>ArtifactId.Filename</tt>. If you set the namespace as the artifactId, you do not need to list all the resx files in the <tt>pom.xml</tt>.</p>
<p><b>Note</b>: This feature does not support cultured esx files such as <tt>eu-US</tt>, <tt>it</tt>, <tt>jp</tt>, <tt>de</tt>, <tt>eu-UK</tt>, and even custom culture.</p>
</div>
<div class="section"><h3>Importing WPF/WCF Projects with XAML files</h3>
<p>If the project you are Importing is a WPF/WCF project and it contains a XAML file the MSBuildPlugin will be automatically added into that project's pom file.</p>
<div class="source"><pre>  &lt;plugin&gt;
        &lt;groupId&gt;npanday.plugin&lt;/groupId&gt;
        &lt;artifactId&gt;NPanday.Plugin.Msbuild.JavaBinding&lt;/artifactId&gt;
        &lt;extensions&gt;true&lt;/extensions&gt;
        &lt;executions&gt;
          &lt;execution&gt;
            &lt;goals&gt;
              &lt;goal&gt;compile&lt;/goal&gt;
            &lt;/goals&gt;
          &lt;/execution&gt;
        &lt;/executions&gt;
  &lt;/plugin&gt;</pre>
</div>
<p>This will generate the needed *.g.cs/*.g.vb files that are needed for those XAML files. </p>
<p>Note: The user would encounter double dependency errors, if the project was created with 3.0 .net framework. We suggest that you change your framework to 3.5 and then delete the references that are already included as defaults in NPanday. This will then allow your project to run successfully.</p>
</div>
</div>

      </div>
    </div>
    <div class="clear">
      <hr/>
    </div>
    <div id="footer">
      <div class="xright">&#169;  
          2010
    
          NPanday
          
  

  
    
  
  
    
  </div>
      <div class="clear">
        <hr/>
      </div>
    </div>
  </body>
</html>
